
/**
 * 1-100数字之合
 */
public class SumTest {
    public static void main(String[] args) {
        int sum = 0;
        for (int i = 0; i <= 100; i++) {
            sum += i;
        }
        System.out.println(sum);
    }
}

/**
 * 1-100偶数合
 */
class SumTest2{
    public static void main(String[] args) {
        int sum = 0;
        for (int i = 0; i <= 100; i++) {
            if (i%2 ==0){
                sum += i;
            }
        }
        System.out.println(sum);
    }
}

/**
 * 1-100奇数合
 */
class SumTest3{
    public static void main(String[] args) {
        int sum = 0;
        for (int i = 0; i <= 100; i++) {
            if (i%2 !=0){
                sum += i;
            }
        }
        System.out.println(sum);
    }
}
